package com.fzj.charging.user.controller;

import com.fzj.charging.common.pojo.JsonResult;
import com.fzj.charging.common.pojo.vo.UserInfoVO;
import com.fzj.charging.user.service.UserService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/user")
@RestController
@Slf4j
@Api(tags = "用户接口")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/info/{userId}")
    public JsonResult<UserInfoVO> getUserInfo(@PathVariable Integer userId){
        log.debug("获取用户信息，参数：{}",userId);
        UserInfoVO userInfo = userService.getUserInfo(userId);
        return JsonResult.ok(userInfo,"获取用户信息成功");

    }
}
